package design.factory.simple.version01;

import design.factory.simple.version01.EmailSender;
import design.factory.simple.version01.QQSender;
import design.factory.simple.version01.Sender;

public class SenderFactory {
    public static final int QQ = 1;
    public static final int EMAIL = 2;
    public static Sender getInstance(int type){
        Sender sender = null;
        switch(type){
            case QQ:
                sender = new QQSender();
                break;
            case EMAIL:
                sender = new EmailSender();
                break;
        }
        return sender;
    }
}
